﻿<sad:ActivityDesigner x:Class="CommentOutActivityDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sad="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities">

    <sap:ActivityDesigner.Icon>
        <DrawingBrush >
            <DrawingBrush.Drawing>
                <ImageDrawing ImageSource="{Binding Source={StaticResource ActIcoCommentout}}">
                    <ImageDrawing.Rect>
                        <Rect Location="0,0" Size="16,16" ></Rect>
                    </ImageDrawing.Rect>
                </ImageDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </sap:ActivityDesigner.Icon>    
    <sad:ActivityDesigner.Resources>
        <ResourceDictionary >
            <DataTemplate x:Key="ExpandedCommentOutTemplate">
                <Border BorderThickness ="1">
                    <sad:WorkflowItemPresenter
                        AutomationProperties.AutomationId="Body"
                        Item="{Binding Path=ModelItem.Body, Mode=TwoWay}"
                        AllowedItemType="{x:Type sa:Activity}"
                        HintText="{Binding Source={StaticResource ActCODropArea}}"
                        Margin="5,5,5,5" />
                </Border>
            </DataTemplate>
            <DataTemplate x:Key="CollapsedActivityViewTemplate">
                <Label Padding="0,0,0,0" FontStyle="Italic"
                       Foreground="{x:Static SystemColors.GrayTextBrush}" HorizontalAlignment="Center"
                       VerticalAlignment="Center" Content="{Binding Source={StaticResource ActCODoubleClick}}"></Label>
            </DataTemplate>
            <Style x:Key="CommentOutStyle" TargetType="{x:Type ContentPresenter}">
                <Setter Property="ContentTemplate" Value="{DynamicResource CollapsedActivityViewTemplate}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=ShowExpanded}" Value="true">
                        <Setter Property="ContentTemplate" Value="{DynamicResource ExpandedCommentOutTemplate}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ResourceDictionary>
    </sad:ActivityDesigner.Resources>
    <ContentPresenter Style="{DynamicResource CommentOutStyle}" Content="{Binding}" />
</sad:ActivityDesigner>

